<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/views/inc/jstltaglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="decorator" content="main" />
<title>内容增加</title>

<script type="text/javascript" src="${contextPath}/static/jquery.min.js"></script>
<script type="text/javascript"
	src="${contextPath}/ckfinder2.4.1/ckfinder.js"></script>
<script type="text/javascript"
	src="${contextPath}/ckeditor4.4.6/ckeditor.js"></script>
<script type="text/javascript">
		   $(function(){
			   var editor=CKEDITOR.replace('content'); //参数content是textarea元素的name属性值，而不是id属性值
			   CKFinder.setupCKEditor(editor,"${contextPath}/ckfinder2.4.1/"); 
			   
			   $.post("${contextPath}/content/SaveContentServlet.do?nav=columnname",
					   function(data){
				   		  var str;
				   		  for(var i=0; i<data.length; i++){
				   			  str = str+"<option value=\'"+ data[i].name+"\'>"+ data[i].name +"</option>";
				   		  }
				   		  $("#columnName").append(str);
					   }, "json");
		   });
		
	</script>
</head>
<body>
	<ul class="breadcrumbs">
		<li><a href="${ctx}/login/LoginIndexRequestServlet.do"><i class="iconfa-home"></i></a> <span
			class="separator"></span></li>
		<li><a href="${ctx}/content/ContentOptRequestServlet.do">内容管理</a> <span class="separator"></span></li>
		<li>内容新增</li>
	</ul>
	<div class="maincontent">
		<div class="maincontentinner">
			<div class="row-fluid">
				<div class="span12">
					<div class="widget">
						<h4 class="widgettitle">内容新增</h4>
						<div class="widgetcontent">
							<form
								action="${contextPath}/content/SaveContentServlet.do?id=${requestScope.contentInfo.id}"
								method="post">
								<table>
									<tr>
										<td>所属栏目</td>
										<td><select id="columnName" name="columnName">
										</select></td>
									</tr>
									<tr>
										<td>文章标题</td>
										<td><input value="${requestScope.contentInfo.title}"
											id="titleName" type="text" name="titleName" /> 文章状态<select
											id="states" name="states">
												<option value="Y">已发布</option>
												<option value="N">未发布</option>
										</select></td>
									</tr>
									<tr>
										<td>文章关键字</td>
										<td><textarea rows="2" cols="150" name="keywords">${requestScope.contentInfo.keyword}</textarea>
										文章权重<textarea rows="2" cols="150" name="orderscore">${requestScope.contentInfo.orderscore}</textarea>
										</td>
									</tr>
									<tr>
										<td>文章内容</td>
										<td><textarea id="content" name="content" rows="5"
												cols="30">${requestScope.contentInfo.content}</textarea></td>
									</tr>

									<tr>
										<td colspan="2" align="center"><input type="submit"
											value="提交" /></td>
									</tr>
								</table>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

</body>
</html>